feat: multi-provider session scanning for discover and learn#255
Open
sahilmgandhi wants to merge 1 commit intortk-ai:masterfrom
Open
feat: multi-provider session scanning for discover and learn#255sahilmgandhi wants to merge 1 commit intortk-ai:masterfrom
sahilmgandhi wants to merge 1 commit intortk-ai:masterfrom
Conversation
Add support for scanning sessions from Codex CLI, Cline, and Cursor in addition to Claude Code. Each tool has a dedicated provider that knows how to find and parse its session format: - CodexProvider: JSONL rollout files from ~/.codex/sessions/ - ClineProvider: JSON conversation files from ~/.cline/tasks/ - CursorProvider: SQLite databases (state.vscdb + store.db) Both `rtk discover` and `rtk learn` now loop over all installed providers. A new `--tool` / `-t` flag filters to a single tool. The report header shows which tools were scanned. Shared infrastructure: ToolSource enum, cutoff_from_days(), is_recent(), join_tool_uses_with_results(), OUTPUT_PREVIEW_CHARS constant to reduce duplication across providers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A followup to #254, wanted to add more provider support for
rtk discoverandrtk learn. We don't need it forrtk gainsince allrtkcommands automatically populate the sqllite db with usage data.Summary
--tool/-tflag onrtk discoverandrtk learnto filter by tool (claude,codex,cline,cursor)New Providers
~/.codex/sessions/($CODEX_HOMEoverride)~/.cline/tasks/+ VS Code extension storagestate.vscdb(desktop) +store.db(agent CLI)Shared Infrastructure
ToolSourceenum withshort_name()/display_name()build_providers(tool_filter)factory with validationcutoff_from_days(),is_recent(),join_tool_uses_with_results()shared helpersOUTPUT_PREVIEW_CHARSconstant (was magic1000in 4 places)Design Decisions
Ok(vec![])— no errors for missing toolsSessionMeta; Cline/Cursor don't have project-scoped sessionsrusqlitealready existed for trackingTest plan
cargo fmt --all --checkcleancargo clippy --all-targets— 0 errorsrtk discover --allscans all installed toolsrtk discover --tool claudefilters to Claude onlyrtk discover --tool invalidreturns helpful errorrtk discover --format jsonincludestools_scannedfield